package service;

import common.utils.MyMapUtils;
import dao.PayInfoDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pojo.PayInfo;
import pojo.form.PayInfoAddForm;
import pojo.form.PayInfoQueryForm;

import java.util.List;

/**
 * Created by asus on 2018/10/31.
 */
@Service
public class PayInfoService {
    @Autowired
    PayInfoDao payInfoDao;

    public int addPayInfo(PayInfoAddForm addForm) {
        return payInfoDao.addPayInfo(addForm);
    }

    public List<PayInfo> getPayInfo(PayInfoQueryForm queryForm) {
        return payInfoDao.getPayInfo(queryForm);
    }

    public PayInfo getPayInfo(String orderCode){
        return payInfoDao.getPayInfo(orderCode);
    }

    public int updatePayInfo(String orderCode, String transactionId,String orderDes,int totalFee){
        return payInfoDao.updatePayInfo(orderCode,transactionId,orderDes,totalFee);
    }
    public int updatePrepay_id(String prepay_id,String orderCode){
        return payInfoDao.updatePrepay_id(prepay_id,orderCode);
    }
    public int refund(String orderCode,Double amount,String refundCode){
        return payInfoDao.refund(orderCode,amount,refundCode);
    }
}